<script type="text/javascript">
function cek_foto(){
        str=document.getElementById('ttd').value.toUpperCase();
        suffix=".JPG";
        
        if(!(str.indexOf(suffix, str.length - suffix.length) !== -1)){
        alert('Tipe File tidak boleh,\nTipe File yang boleh : *.jpg');
            document.getElementById('ttd').value='';
        }
    }
</script>

<div id="tiga_ba">
	<div id="tiga_baa">Ubah Data Pejabat</div>
	<div id="tiga_bab"></div>
	<div class="clear"></div>
</div>
            
<?php
	$id=$_GET['id'];
	$sql="select * from setting where id_setting = $id";
	$qry=mysql_query($sql);
	$hasil=mysql_fetch_array($qry);
?>
<form action="utama.php?module=mod_setting&act=update" onsubmit="return gsValidate('jabatan|pejabat','Jabatan Harus Diisi|Nama Pejabat Harus Diisi','required|required');" method="post" enctype="multipart/form-data">
	<table style="margin: 10px 15px 10px 15px;">
		<tr>
			<td>Jabatan</td>
			<td>&nbsp;</td>
			<td>
				<input name="jabatan" type="text" class="input2" id="jabatan" maxlength="50" value="<?php echo $hasil['jabatan']?>"/>
				<input name="id" type="hidden" id="id" value="<?php echo $hasil['id_setting']?>" />
				<span class="red">*</span>
			</td>
		</tr>
		<tr>
			<td>Nama Pejabat</td>
			<td>&nbsp;</td>
			<td>
				<input name="pejabat" type="text" class="input2" id="pejabat" maxlength="50" value="<?php echo $hasil['nama']?>"/>
				<span class="red">*</span>
			</td>
		</tr>
		<tr>
			<td>Tanda Tangan</td>
			<td>&nbsp;</td>
			<td>
				<?php
					if($hasil['ttd'] != ''){
						echo "<img src='asset/images/$hasil[ttd]' height='50'>";
					}
				?>
				<br>
				<input type="file" name="ttd" id="ttd">
				<span class="red">*)</span>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td><input name="submit" type="submit" class="button" value="Ubah" /></td>
		</tr>
		<tr>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr>
			<td colspan="3"><span class="red">*) Pilih file untuk mengubah tanda tangan.</span></td>
		</tr>
	</table>
</form>		
            
        